﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace RestaurantBooker.Controls
{
    public partial class OrderFilterElement : UserControl
    {
        #region Properties
        /// <summary>
        /// The <see cref="StartDateTime" /> dependency property's name.
        /// </summary>
        public const string StartDateTimePropertyName = "StartDateTime";

        /// <summary>
        /// Gets or sets the value of the <see cref="StartDateTime" />
        /// property. This is a dependency property.
        /// </summary>
        public DateTime StartDateTime
        {
            get
            {
                return (DateTime)GetValue(StartDateTimeProperty);
            }
            set
            {
                SetValue(StartDateTimeProperty, value);
            }
        }

        /// <summary>
        /// Identifies the <see cref="StartDateTime" /> dependency property.
        /// </summary>
        public static readonly DependencyProperty StartDateTimeProperty = DependencyProperty.Register(
            StartDateTimePropertyName,
            typeof(DateTime),
            typeof(OrderFilterElement),
            new PropertyMetadata(DateTime.Now));


        /// <summary>
        /// The <see cref="EndDateTime" /> dependency property's name.
        /// </summary>
        public const string EndDateTimePropertyName = "EndDateTime";

        /// <summary>
        /// Gets or sets the value of the <see cref="EndDateTime" />
        /// property. This is a dependency property.
        /// </summary>
        public DateTime EndDateTime
        {
            get
            {
                return (DateTime)GetValue(EndDateTimeProperty);
            }
            set
            {
                SetValue(EndDateTimeProperty, value);
            }
        }

        /// <summary>
        /// Identifies the <see cref="EndDateTime" /> dependency property.
        /// </summary>
        public static readonly DependencyProperty EndDateTimeProperty = DependencyProperty.Register(
            EndDateTimePropertyName,
            typeof(DateTime),
            typeof(OrderFilterElement),
            new PropertyMetadata(DateTime.Today.AddDays(1).AddMilliseconds(-1))); // end of the current day
        #endregion

        public OrderFilterElement()
        {
            InitializeComponent();
            this.Self.DataContext = this;
        }
    }
}
